GadgetView

A custom WebView subclass designed to display "gadgets," which are typically web-based applications or content modules.

GadgetView configures a WebView with specific settings for optimal performance and compatibility with web content, including JavaScript execution, plugin support, and local storage. It interfaces with an external caching library (ren.yale.android.cachewebviewlib.WebViewCacheInterceptorInst) for custom caching behavior.

This view implements RevelControl for integration into a broader playback system and OnCommandListener to receive and relay commands to the loaded gadget via JavaScript. It also manages a list of OnCallbackListener instances to communicate events or data from the gadget back to interested components.

Gadgets are loaded from a specific URL pattern involving "shindig.reveldigital.com," with parameters derived from the provided Module object.

See also

JavascriptInterfaceObject
WebViewCacheInterceptorInst

Constructors

Link copied to clipboard
constructor(context: Context, module: Module)
Constructs a new GadgetView.

Functions

Link copied to clipboard
Adds a listener to be notified of callbacks from the loaded gadget.
Link copied to clipboard
open fun dispose()
Performs cleanup operations for the GadgetView.
Link copied to clipboard
open fun executeJavascript(script: String)
Executes the supplied JavaScript string within the context of the loaded web page.
open fun executeJavascript(script: String, @Nullable callback: ValueCallback<String>)
Executes the supplied JavaScript string within the context of the loaded web page and provides a callback for the result.
Link copied to clipboard
open fun getName(): String
Gets the unique name assigned to this control.
Link copied to clipboard
open fun getOptions(): Iterator<out Option>
Gets an iterator over the configuration s for this control.
Link copied to clipboard
open fun getPlaylist(): Playlist
Gets the associated with this control, if any.
Link copied to clipboard
open fun getType(): ModuleType
Gets the type of the underlying module or content associated with this control.
Link copied to clipboard
open fun getZIndex(): Int
Gets the Z-index (stacking order) of this control.
Link copied to clipboard
open fun initialize(module: Module)
Initializes the control with its associated module context.
Link copied to clipboard
open fun isAutoStart(): Boolean
Checks if this control is configured to start its operation automatically after #initialize(Module) initialization.
Link copied to clipboard
open fun isStarted(): Boolean
Checks if the control is currently in a started or active operational state.
Link copied to clipboard
open fun onCommand(name: String, value: String)
Invoked when a command is received by a component this listener is registered with.
Link copied to clipboard
Initiates printing of the current web page content.
Link copied to clipboard
Removes a previously added OnCallbackListener.
Link copied to clipboard
open fun setAutoStart(flag: Boolean)
Sets whether this control should start its operation automatically after #initialize(Module) initialization.
Link copied to clipboard
open fun start()
Starts or resumes the active operation of this control.
Link copied to clipboard
open fun stop()
Stops or pauses the active operation of this control.